package com.briup.srms.exam.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.srms.exam.bean.PaperQuestion;
import com.briup.srms.exam.bean.PaperQuestionExample;
import com.briup.srms.exam.dao.PaperQuestionMapper;
import com.briup.srms.exam.service.IPaperQuestionService;

@Service
public class PaperQuestionServiceImpl implements IPaperQuestionService {
	@Autowired
	private PaperQuestionMapper paperQuestionMapper;

	@Override
	public PaperQuestion queryByPaperAndQuestionId(long paperId, long questionId) {
		PaperQuestionExample example = new PaperQuestionExample();
		example.createCriteria().andPaperIdEqualTo(paperId).andQuestionIdEqualTo(questionId);
		List<PaperQuestion> list = paperQuestionMapper.selectByExample(example);
		if(list.size()>0) {
			return list.get(0);
		}
		return null;
	}

}
